# coding: utf-8

import sys
sys.path.append('../3_data_structure')
from BinaryTree import BinaryTree

def build_tree():
    r = BinaryTree('a')
    r.insert_left('b')
    r.get_left_child().insert_right('d')

    r.insert_right('c')
    r.get_right_child().insert_left('e')
    r.get_right_child().insert_right('f')

    return r


b = BinaryTree('a')
b.insert_left('b')
b.insert_right('c')
print(b.get_left_child().get_root_val())
print(b.get_right_child())


tree = build_tree()

assert tree.get_right_child().get_root_val() == 'c'
assert tree.get_left_child().get_right_child().get_root_val() == 'd'
assert tree.get_right_child().get_left_child().get_root_val() == 'e'
